home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cenvid / sound.bat < prev    next >
DOS Batch File  |  1995-06-04  |  1KB  |  35 lines

  1. @echo off
  2. REM *******************************************************************
  3. REM *** Sound - Sound a specified frequency for specified number of ***
  4. REM *** ver.2   milliseconds (approximate).                         ***
  5. REM *******************************************************************
  6. CEnviD %0.bat %1 %2 %3
  7. GOTO CENVI_EXIT
  8.  
  9. #include <sound.lib>
  10.  
  11. main(argc,argv)
  12. {
  13.    if ( argc != 3 || 0 == (frequency=atol(argv[1])) || 0 == (duration=atol(argv[2])) )
  14.       Instructions();
  15.    else
  16.       sound(frequency,duration)
  17. }
  18.  
  19. Instructions()
  20. {
  21.    printf("\a\n")
  22.    printf("Sound - Sound a specified tone on the internal speaker for specified time\n")
  23.    printf("\n")
  24.    printf("SYNTAX:  SOUND Freqency Duration\n")
  25.    printf("\n")
  26.    printf("Where:  Frequency     Tone in hertz\n")
  27.    printf("        Duration      In milliseconds, accurate to %d milliseconds\n",1000/CLOCKS_PER_SEC)
  28.    printf("\n")
  29.    printf("The following example would play middle A for 2 seconds:\n");
  30.    printf("    SOUND 440 2000\n")
  31.    printf("\n")
  32. }
  33.  
  34. :CENVI_EXIT
  35.